<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>伪元素选择题</title>
  <style>
    div {
      width: 300px;
      height: 300px;
      background-color: pink;
    }

    div::before {
      content: "老鼠";

      width: 100px;
      height: 100px;
      background-color: green;
      display: block;
    }

    /* 必须设置 connect 属性，没有 connect，伪元素选择器不生效 */
    div::after {
      content: "大米";

      width: 100px;
      height: 100px;
      background-color: red;
      display: inline-block;
    }
  </style>
</head>

<body>
  <!-- 标签内容：老鼠爱大米 -->
  <div>爱</div>
</body>

</html>